/*
 * JPanelWizardSelectAlign.java
 *
 * Created on 04-sep-2011, 20:25:31
 */
package com.ufps.cuatro.vistas.representacion.wizard.clase;

import com.ufps.cuatro.modelo.representacion.ObjetoTipoDatoReflexion;
import com.ufps.cuatro.modelo.representacion.UtilRepresentacion;
import com.ufps.cuatro.util.TipoCaso;
import java.util.ArrayList;
import javax.swing.JComboBox;

/**
 *
 * @author Carlos A. Torres C. 
 */
public class JPanelWizardSelectClass extends javax.swing.JPanel {
    private static final long serialVersionUID = -1906702795411867723L;
    
    private ObjetoTipoDatoReflexion objTipoDato;   
    private Object objParent;
    private ArrayList<ObjetoTipoDatoReflexion> objTiposClase = null;        

    /** Creates new form JPanelWizardSelectAlign */
    public JPanelWizardSelectClass() {
        initComponents();
        this.objTiposClase = UtilRepresentacion.getColeccionTipoDatoReflexion(TipoCaso.eClaseMundo);
        JComboBox objCombo = new JComboBox(objTiposClase.toArray());
        this.jComboBoxClases.setModel(objCombo.getModel());                  
    }

    public ObjetoTipoDatoReflexion getObjTipoDato() {
        return objTipoDato;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jComboBoxClases = new javax.swing.JComboBox();

        setName("Form"); // NOI18N

        jComboBoxClases.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccione una Clase" }));
        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance().getContext().getActionMap(JPanelWizardSelectClass.class, this);
        jComboBoxClases.setAction(actionMap.get("seleccionClase")); // NOI18N
        jComboBoxClases.setName("jComboBoxClases"); // NOI18N
        jComboBoxClases.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxClasesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jComboBoxClases, 0, 441, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jComboBoxClases, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(194, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jComboBoxClasesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxClasesActionPerformed
        if(this.jComboBoxClases.getSelectedIndex() > -1){
            if(this.jComboBoxClases.getSelectedItem() instanceof ObjetoTipoDatoReflexion){
                objTipoDato = (ObjetoTipoDatoReflexion) this.jComboBoxClases.getSelectedItem();            
            }                            
        }
    }//GEN-LAST:event_jComboBoxClasesActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox jComboBoxClases;
    // End of variables declaration//GEN-END:variables
}
